<template>
	<view class="bottom-nav-box">
		
		<block v-if="currentIndex == 1">
			<view class="bottom-nav-item">
				<view class="bottom-nav-img-box">
					<image src="../static/images/chat_a.png" class="bottom-nav-img"></image>
				</view>
				<view class="bottom-nav-label">咨询</view>
			</view>
		</block>
		<block v-else>
			<view class="bottom-nav-item" @tap="goGroupChatList">
				<view class="bottom-nav-img-box">
					<image src="../static/images/chat.png" class="bottom-nav-img"></image>
				</view>
				<view class="bottom-nav-label">咨询</view>
			</view>
		</block>
		
		<view class="bottom-nav-rank-item">
			<view class="bottom-nav-img-box" @tap="goPublish">
				<image :src="rankSrc" class="bottom-nav-rank-img"></image>
			</view>
			<view class="bottom-nav-label">发说说</view>
		</view>
		
		<block v-if="currentIndex == 2">
			<view class="bottom-nav-item">
				<view class="bottom-nav-img-box">
					<image src="../static/images/trends_a.png" class="bottom-nav-img"></image>
				</view>
				<view class="bottom-nav-label">动态</view>
			</view>
		</block>
		<block v-else>
			<view class="bottom-nav-item" @tap="goHome">
				<view class="bottom-nav-img-box">
					<image src="../static/images/trends.png" class="bottom-nav-img"></image>
				</view>
				<view class="bottom-nav-label">动态</view>
			</view>
		</block>
		
		
	</view>
</template>

<script>
	export default {
		props: ['currentIndex'],
		data() {
			return {
				rankSrc: '../static/images/publish_nav.png'
			}
		},
		
		methods: {
			
			goHome() {
				uni.redirectTo({
					url: '/pages/teacher_index/teacher_index'
				})
			},
			
			goGroupChatList() {
				uni.redirectTo({
					url: '/pages/teacher_group_chat_list/teacher_group_chat_list'
				})
			},
			
			goPublish() {
				uni.navigateTo({
					url: '/pages/publish/publish'
				})
			}
			
		}
	}
</script>

<style>
	.bottom-nav-box {
		position: fixed;
		display: flex;
		justify-content: space-evenly;
		bottom: 0;
		left: 0;
		z-index: 200;
		background-color: #ffffff;
		width: 100%;
		height: 96rpx;
		align-items: center;
	}
	
	.bottom-nav-label {
		font-size: 24rpx;
		color: #333333;
	}
	
	.bottom-nav-label-active {
		color: #5683ec !important;
	}
	
	.bottom-nav-item {
		flex: 1;
		display: flex;
		flex-direction: column;
		align-items: center;
	}
	
	.bottom-nav-rank-item {
		flex: 1;
		display: flex;
		flex-direction: column;
		align-items: center;
		margin-top: -84rpx;
	}
	
	.bottom-nav-img {
		width: 50rpx;
		height: 50rpx;
	}
	
	.bottom-nav-rank-img {
		width: 138rpx;
		height: 138rpx;
	}
	
	.bottom-nav-img-box {
		display: flex;
		justify-content: center;
		align-items: center;
	}
	
	.publish-plus {
		position: absolute;
		font-size: 100rpx;
		color: #ffffff;
	}
</style>
